<h:panelGroup xmlns:h='http://java.sun.com/jsf/html'
              xmlns:f='http://java.sun.com/jsf/core'
              xmlns:p='http://primefaces.org/ui'
              xmlns:z='http://savanti.com.bo/ui'
              xmlns:x='http://java.sun.com/jsf/composite/ui/component' styleClass='IIVentasVendedor' id='IIVentasVendedor'><p:growl id='growl'/>

<p:toolbar styleClass='toolBar'>

<p:toolbarGroup style='width:100%'>

<p:commandButton icon='ui-icon-new'  title='Nuevo' actionListener='#{IIVentasVendedor.uiClean}'  update='@(.IIVentasVendedor)' style='width:70px;border: none;' process='@this'/>

<p:commandButton id='#{formId}btnTitle' value='RESUMEN' style='width:10%;position:absolute;left:40%;background: transparent;border: none;font-weight: bold' actionListener='#{IIVentasVendedor.uiForm}'  update='@(.IIVentasVendedor)' process='@this'/>

<p:commandButton icon='ui-icon-find' title='Buscar'  actionListener='#{IIVentasVendedor.uiFind}'   update='@(.IIVentasVendedor)' style='width:70px;float:right;border: none' process='@(.IIVentasVendedor)'/>

</p:toolbarGroup>

</p:toolbar>


<p:contextMenu for='#{formId}btnTitle' style='width:80px' rendered='#{not empty IIVentasVendedor.lsEntity}'>

<p:menuitem icon='ui-icon-print' style='padding-left:8px' value='.. csv' ajax='false'><p:dataExporter type='csv' target='tblPrd' fileName='RESUMEN VENTAS X CAJERO'/></p:menuitem>

<p:menuitem icon='ui-icon-print' style='padding-left:8px' value='.. xls' ajax='false'><p:dataExporter type='xls' target='tblPrd' fileName='RESUMEN VENTAS X CAJERO' postProcessor='#{IIVentasVendedor.processXLS}'/></p:menuitem>

<p:menuitem icon='ui-icon-search' style='padding-left:8px' value='.. Filtrar' actionListener='#{IIVentasVendedor.uiFilter}'  update='@(.IIVentasVendedor)' process='@this'/>

</p:contextMenu>


<h:panelGrid columns='2' width='100%' rendered='#{IIVentasVendedor.form}'>

  <h:panelGrid id='bean' columns='2' styleClass='bean align-top'>

  <x:beanPanel id='hd' bean='#{IIVentasVendedor}' title='Resumen venta' cellpadding='8' columns='1'>

  <x:fieldN t='Importe'   v='#{bean.entity.importe}'   w='150px'/>

  <x:fieldN t='Descuento' v='#{bean.entity.descuento}' w='150px'/>

  <x:fieldN t='Total'     v='#{bean.entity.total}'     w='150px' style='color:#ffcc25'/>

  </x:beanPanel>


  <x:beanPanel id='ps' bean='#{IIVentasVendedor}' title='Buscar' cellpadding='6' columns='1' style='min-width: 300px'>

  <x:fieldD t='Desde'    v='#{bean.dateIni}'         w='70px'/>

  <x:fieldD t='Hasta'    v='#{bean.dateEnd}'         w='70px'/>

  <x:fieldS t='Vendedor' v='#{bean.entity.vendedor}' w='200px' x='#{x}' xL='#{x.persona.nombre}' b='#{bean}'/>

  </x:beanPanel>

  </h:panelGrid>

</h:panelGrid>


<p:dataTable id='tblPrd' value='#{IIVentasVendedor.lsEntity}' var='x' paginator='true' paginatorPosition='bottom' rows='500' resizableColumns='true' rendered='#{not empty IIVentasVendedor.lsEntity}'

             paginatorAlwaysVisible='false' emptyMessage='' selectionMode='single' rowKey='#{x[0].id}' filteredValue='#{IIVentasVendedor.lsFiltered}' style="width:100%;background: transparent">

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[0].id}'     sortBy='#{x[0].id}'     style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Codigo'  /></f:facet><h:outputText value='#{x[0].id}'/>      </p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[0].nombre}' sortBy='#{x[0].nombre}' style='background:transparent'>                            <f:facet name='header'><h:outputText value='Nombre'  /></f:facet><h:outputText value='#{x[0].nombre}'/>  </p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[1]}'        sortBy='#{x[1]}'        style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Cantidad'/></f:facet><z:outputN v='#{x[1]}' r='0'/></p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[2]}'        sortBy='#{x[2]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Precio'  /></f:facet><z:outputN v='#{x[2]}'/>          </p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[3]}'        sortBy='#{x[3]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Importe' /></f:facet><z:outputN v='#{x[3]}'/>          </p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[4]}'        sortBy='#{x[4]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Desc.'   /></f:facet><z:outputN v='#{x[4]}'/>          </p:column>

  <p:column rendered='#{IIVentasVendedor.filter}' filterMatchMode='contains' filterStyleClass='columnFind' filterBy='#{x[5]}'        sortBy='#{x[5]}'        style='background:transparent;width:50px;font-weight:bold'><f:facet name='header'><h:outputText value='Total'   /></f:facet><z:outputN v='#{x[5]}'/>          </p:column>


  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[0].id}'     style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Codigo'  /></f:facet><h:outputText value='#{x[0].id}'/>      </p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[0].nombre}' style='background:transparent'>                            <f:facet name='header'><h:outputText value='Nombre'  /></f:facet><h:outputText value='#{x[0].nombre}'/>  </p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[1]}'        style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Cantidad'/></f:facet><z:outputN v='#{x[1]}' r='0'/></p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[2]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Precio'  /></f:facet><z:outputN v='#{x[2]}'/>          </p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[3]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Importe' /></f:facet><z:outputN v='#{x[3]}'/>          </p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[4]}'        style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Desc.'   /></f:facet><z:outputN v='#{x[4]}'/>          </p:column>

  <p:column rendered='#{!IIVentasVendedor.filter}' sortBy='#{x[5]}'        style='background:transparent;width:50px;font-weight:bold'><f:facet name='header'><h:outputText value='Total'   /></f:facet><z:outputN v='#{x[5]}'/>          </p:column>

</p:dataTable>

</h:panelGroup>    